package com.yangff.entity.user.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * <p>
 * 存储用户的基金资产信息
 * </p>
 *
 * @author yangff
 * @since 2025-02-12
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("user_asset")
public class UserAsset implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 关联用户表的用户账号
     */
    @TableId(value = "account", type = IdType.INPUT)
    private String account;

    /**
     * 基金代码
     */
    private String code;

    /**
     * 基金名称
     */
    private String name;

    /**
     * 用户本金
     */
    private Double seedMoney;

    /**
     * 交易金额
     */
    private Double amount;

    /**
     * 持有份额
     */
    private Double shares;

    /**
     * 购买日期
     */
    private LocalDateTime purchaseDatetime;

    /**
     * 资产状态，0为冻结，1为正常，默认为1
     */
    private Boolean status;

    /**
     * 基金每天走向的变化率
     */
    private Double changeRate;


}
